function states_ = gXrandom_statelist(varargin)

waitMove = { ...
    'dXkbHID',  {'f', 'slowDown', 'j', 'slowUp', 'h', 'waitLook', 1}; ...
    'dXgameHID', {[3:6]', 'waitLook', 7, 'slowDown', 8, 'slowUp', ...
    [1, -1], 'fastDown', [1, 1], 'fastUp', 1}; ...
    'dXasl',    {}};

b = [1,7,8]';
goBack = { ...
    'dXkbHID',  {{['fj']',0}, 'waitMove'}; ...
    'dXgameHID', {[b,0*b], 'waitMove'}; ...
    'dXasl',    {}};

waitLook = { ...
    'dXkbHID',  {}; ...
    'dXgameHID', {}; ...
    'dXasl',    {[-3,-4,6,8,true,inf], 'inBox'}};

stayLook = { ...
    'dXkbHID',  {}; ...
    'dXgameHID', {}; ...
    'dXasl',    {[-3,-4,6,8,false,inf], 'stayStupid'}};

rU = @rVarUpdate;
cm = @compareEstimate;
mv = @moveLine;
SP = @rPlay;
rE = @resetEst;
BT = @setBadTrialFlag;
rw = @updateReward;

nxt = 'next';
err = 'error';
wmv = 'waitMove';
wlk = 'waitLook';
lks = 'lookStupid';
cmp = 'compare';
sd = 'slowDown';
su = 'slowUp';
fd = 'fastDown';
fu = 'fastUp';
dr = 'dXdistr';
rt = {'dXtext', 1, 'string'};
lss = {'dXsound', 3};
sss = {'dXsound', 4};
ess = {'dXsound', 5};   
gt = 'goTime';

t = true;
f = false;

% THE STATE DINNER. Careful -- this MUST be a double cellery.
%
%   You know those guitars that are like *double* guitars?
%
%   name        fun args        jump    wait    repsDrawQuery   cond
arg_dXstate = {{ ...
    'reset',   rE, {0, varargin{1}, []},nxt,  0,     0,  3,  0,          {};
    'waitMove', @disp, {'waitMove'},'end',6e5,	 0,  3,  waitMove,   {}; ...
    'slowDown', mv, {[],2,-1,t, []}, sd,     150,    0,  3,  goBack,     {}; ...
    'slowUp',   mv, {[],2,+1,t, []}, su,     150,    0,  3,  goBack,     {}; ...
    'fastDown', mv, {[],2,-1,t, []}, fd,     0,      0,  3,  goBack,     {}; ...
    'fastUp',   mv, {[],2,+1,t, []}, fu,     0,      0,  3,  goBack,     {}; ...
    ...
    'waitLook', @disp, {'waitLook'},nxt,5e3,    0,  0,  waitLook,   {}; ...
    'lookStupid',SP,lss,        wlk,    0,      0,  0,  0,          {}; ...
    'inBox',     SP,sss,        nxt,    0,      0,  0,  0,          {}; ...
    'newNumber',rU, {dr},       nxt,    0,      0,  3,  0,          {}; ...
    'compare',  cm, {4, []}         nxt,    0,      0,  3,  0,          {}; ...
    'stayLook', @disp, {'stayLook'},gt ,2e3,    0,  0,  stayLook,   {}; ...
    'stayStupid',BT,{},         lks,    0,      0,  0,  0,          {}; ...
    'goTime'    ,SP,ess,        nxt,    0,      0,  0,  0,          {}; ...
    'reward',   rw, {4},        nxt,    0,      0,  3,  0,          {}; ...
 
    ...
    'end',      {}, {},         'x',    0,      0,  0,  0,          {}; ...
    }};
sz = size(arg_dXstate{1}, 1);

tony = {'current', true, true, false};
states_ = {'dXstate', sz, tony, arg_dXstate};